package com.it.flowable.dto;

import lombok.Data;

import java.util.Date;

@Data
public class ProcessInstanceQueryVo {
    private Integer page = 1;
    private Integer size = 10;
    private Integer firstResult;
    private Integer maxResults;
    
    // 查询条件
    private String processInstanceId;
    private String processDefinitionId;
    private String processDefinitionKey;
    private String processDefinitionName;
    private String businessKey;
    private String startedBy;
    
    // 状态筛选
    private Boolean unfinished;
    private Boolean finished;
    private Boolean deleted;
    
    // 时间范围
    private Date startedAfter;
    private Date startedBefore;
    private Date finishedAfter;
    private Date finishedBefore;
    
    public Integer getFirstResult() {
        if (firstResult != null) return firstResult;
        return (page - 1) * size;
    }
    
    public Integer getMaxResults() {
        if (maxResults != null) return maxResults;
        return size;
    }
}